import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../view/home/Home'
import Login from '../view/login/Login'

//使用路由组件
Vue.use(VueRouter)

//定义路由的json变量
const routes=[
    {
        path:'/',
        name:'Home',
        component:Home
    },
    {
        path:'/login',
        name:'Login',
        component: Login
    },
]

//创建VueRouter对象
const router=new VueRouter({
    mode: 'history',
    base: process.env.BASE_URL,
    routes
})

//导出路由对象
export default router
